#include "Col.ph"
#ifdef __GNUG__
#pragma implementation
#endif

#include "ProgressFilter.h"

//---- ProgressFilter ----------------------------------------------------------

ProgressFilter::ProgressFilter() : StreamBuf()
{
}

int ProgressFilter::Underflow(u_char*, int n)
{
	n= sb->salloc(&base, BUFSIZE);
	if (n == EOF)
		return EOF;
	if (gProgress->Inc(n))
		return EOF;
	return n;
}

int ProgressFilter::Overflow(u_char *bp, int n)
{
	if (gProgress->Inc(n))
		return EOF;
	return sb->sputn((char*)bp, n);
}

